#ifndef _ACTION_MSG_H
#define _ACTION_MSG_H


#include "common.h"
#include "msg_def.h"

extern int g_msg_id_lua;

void * thread_recv_msg(void * param);

int uimMoveAct(move_param * paramIn, int num, int timeOut_mm);

int uimMoveAct_multi(move_param * paramIn, int num, int timeOut_ms);

int uimInitAct_multi(move_param * paramIn, int num, int timeOut_ms);

int adpCtl(const void * paramIn,unsigned int opcodeIn, int timeOut_mm);

int initLuaActMsg(void);

int deinitLuaActMsg(void);

int Dp8Suck(const void * paramIn);

int uimMoveAct_multi_relative(move_param * paramIn, int num, int timeOut_ms);

typedef struct _lua_thread_param
{
    int msg_id;
    int numAct;
    eleActCheck * pstCheckData;
}lua_thread_param;


typedef struct _dp8_suck_param
{
    int quantityRemain;//ul used to calculate the previous height
    int quantityToSuck;//ul 
    int speedSuck;//ul/s
    int neckHeight;//the height of the tube from neck to bottom mm
    int bottomType;//semisphere, cone//
    int posMax;//the z max position
    int volumeSuckMore;// suck more ul
    int volumeSpitBack;//spit back ul
}dp8_suck_param;

int Dp8Droptip(int posLow, int posUp);

int ScancodeCtl(const void * paramIn,unsigned int opcodeIn, int timeOut_mm);
int  djCleanCtl(const void * paramIn,unsigned int opcodeIn, int timeOut_ms);
int  drawerLockCtl(const void * paramIn,unsigned int opcodeIn, int timeOut_ms);

int  readTempCtl(const void * paramIn,int boardIdIn,unsigned int opcodeIn, int timeOut_ms);
#define SID_DP8_Z 15
#define SID_DP8_SUCK 14

#ifdef _GP_1
#define SID_DP8_X 81
#define SID_DP8_Y 80
#else
#define SID_DP8_X 36
#define SID_DP8_Y 37
#endif

#define SID_DP8_JAW 35

#define SID_DP8_JAWZ 34

#define SID_DP8_DROPTIP 32

#define SID_DP8_1_Z 33

#define SID_DP8_1_PUMP 47

#define LEAD_SUCK 4.8768 //4.8768mm <->3200 steps
#define LEAD_Z 5.08 //5.08mm <->3200 steps


extern const float coeffmmToStep_Suck;//steps/mm //3200 steps<->4.8768mm
extern const float coeffmmToStep_Z;//steps/mm //3200 steps<->5.08mm

extern const float area_cross;// suck pump inner r = 2mm

extern const float coeffUlToSteps_suck;// coeffmmToStep_Suck / area_cross;
extern const float coeffUlToSteps_Z;// coeffmmToStep_Z / area_cross;

typedef enum
{
    PARAM_ACT_ELE_CTL,
    PARAM_ACT_PV_CTL,
    PARAM_ACT_HEAT_CTL,
    PARAM_ACT_SHAKE_CTL,
    PARAM_ACT_ADP_CTL,
}en_act_param_type;

#define MAX_PARALL_ACT 5

typedef union
{
    move_param moveParam;
    djLiquidCtl djPvParam;
}un_action_param;

int  shakeCtl(const void * paramIn,unsigned int opcodeIn, int timeOut_ms);

int sendSubboardMsgAndWaitResp(void * msgIn,void * checkDataIn,int uniqueId, int timeout_ms);

int  qpcrSubCtl(int qpcrId, const void * paramIn,unsigned int opcodeIn, int timeOut_ms);

int  sealCtl(const void * paramIn,unsigned int opcodeIn, int timeOut_ms);


int test_hash(void);

#endif